unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TrayIcon, ExtCtrls;

type
  TFormMain = class(TForm)
    Image1: TImage;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
    FTrayIcon : TTrayIcon;
  public
    { Public declarations }
  end;

var
  FormMain: TFormMain;

implementation

{$R *.dfm}

procedure TFormMain.FormCreate(Sender: TObject);
begin
  FTrayIcon := TTrayIcon.Create(nil);
//  FTrayIcon.HideMainForm := False;
  FTrayIcon.Icon.Assign(Image1.Picture.Icon);

end;

procedure TFormMain.FormDestroy(Sender: TObject);
begin
  FTrayIcon.Free;
end;

end.
